package com.hcss.core.common.logsmgt.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import com.hcss.core.util.DateUtil;


/** 
 * @ClassName: OpertionLog 
 * @Description: TODO 行为审核
 * @author lvfang
 * @date 2013-12-9 下午4:42:26 
 *  
 */
@SuppressWarnings("serial")
@Entity(name="t_opLog")
public class OpertionLog implements Serializable{
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(nullable=false)
	private Integer id;
	
	@Column(name="opModel",nullable=false)
	private String opModel;
	
	@Column(name="opFunction",nullable=false)
	private String opFunction;
	
	@Column(name="opUserId",nullable=false)
	private int opUserId;
	
	@Column(name="opIp",nullable=false)
	private String opIp;
	
	@Column(name="loginTime",nullable=false)
	@Temporal(TemporalType.TIMESTAMP)
	private Date opTime;
	
	@Transient
	private String opTimeStr;
	
	@Column(name="opMark",nullable=false)
	private String opMark;
	
	@Transient
	private String userName;
	
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getOpModel() {
		return opModel;
	}
	public void setOpModel(String opModel) {
		this.opModel = opModel;
	}
	public String getOpFunction() {
		return opFunction;
	}
	public void setOpFunction(String opFunction) {
		this.opFunction = opFunction;
	}
	public int getOpUserId() {
		return opUserId;
	}
	public void setOpUserId(int opUserId) {
		this.opUserId = opUserId;
	}
	public String getOpIp() {
		return opIp;
	}
	public void setOpIp(String opIp) {
		this.opIp = opIp;
	}
	public Date getOpTime() {
		return opTime;
	}
	public void setOpTime(Date opTime) {
		this.opTime = opTime;
	}
	public String getOpMark() {
		return opMark;
	}
	public void setOpMark(String opMark) {
		this.opMark = opMark;
	}
	/**
	 * @return the opTimeStr
	 */
	public String getOpTimeStr() {
		opTimeStr = DateUtil.dateToString(this.getOpTime(), DateUtil.FORMAT_ONE);
		return opTimeStr;
	}
	/**
	 * @param opTimeStr the opTimeStr to set
	 */
	public void setOpTimeStr(String opTimeStr) {
		this.opTimeStr = opTimeStr;
	}
	
}
